#ifndef __HN_ALERTVIEW__
#define __HN_ALERTVIEW__

#include "cocos2d.h"
#include "cocos-ext.h"
USING_NS_CC;
USING_NS_CC_EXT;

class InputField;

#define ALERTVIEW_SIZE CCSizeMake(400, 200)

class HNAlertViewDelegate
{
public:
    virtual void alertViewButtonTouched(int index, char* inputString) = 0;
};

class HNAlertView : public CCNode
{
public:

	bool isBecomeFirstResponder;

	CREATE_FUNC(HNAlertView);
	static HNAlertView* create(char* message, char* leftButtonString, char* rightButtonString, char* inputLabelString, HNAlertViewDelegate* delegate);

	void show(CCNode* node);
	void setDelegate(HNAlertViewDelegate* delegate);
private:
	bool init();
	void leftButtonTouched(CCObject *sender, CCControlEvent controlEvent);
	void rightButtonTouched(CCObject *sender, CCControlEvent controlEvent);
	void endShowAction();

	CCScale9Sprite* backgroundSprite;
	CCControlButton* leftButton;
	CCControlButton* rightButton;
	CCLabelTTF* messageLabel;
	InputField* inputField;
	HNAlertViewDelegate* delegate;
};

#endif // !__HN_ALERTVIEW__
